#include <iostream>
#include <string>

using namespace std;

class Date;

class Time
{
private:
    int hour;
    int min;
    int sec;
public:
    Time()
    {
        hour = 0;
        min = 0;
        sec = 0;
    }
    Time(int hour, int min, int sec):hour(hour), min(min), sec(sec) {}
    ~Time() {}

    friend class Date;
};

class Date
{
private:
    int year;
    int month;
    int day;
public:
    Date() {}
    Date(int year, int month, int day):year(year), month(month), day(day) {}
    ~Date() {}

    void set_Date(Time & T);

    void show_Date(Time & T);
};

void Date::set_Date(Time & T)
{
    cout << "请输入日期(年 月 日):" ;
    cin >> this->year >> this->month >> this->day;

    cout << "请输入时间(时 分 秒):" ;
    cin >> T.hour >> T.min >> T.sec;
}

void Date::show_Date(Time & T)
{
    cout << "日期为:" << this->year << "年 " << this->month << "月 " << this->day << "日" << endl;
    cout << "时间为:" << T.hour << " : " << T.min << " : " << T.sec << endl;
}

int main(int argc, char const *argv[])
{
    Time T;
    Date D;

    D.set_Date(T);

    D.show_Date(T);
    return 0;
}
